Rehabilitation using virtual reality